<?php
class SiteAdmin extends CI_Controller{
	public function __construct(){
		parent::__construct();
		$this->display= new Display('templates/siteadmin');
		$this->load->helper(array('form', 'url','path','file'));
		$editing = $this->input->post('enable_site_editing');
		print_r($editing );
		if( $editing == "on" ){
			$_SESSION['editing']=true;
			$this->display->edtingon = "checked";
		}
		else {
			unset( $_SESSION['editing'] );
		}
		$this->display->addJSInit("
		$(function() {
		$('#enable_site_editing').button();
		$('#enable_site_editing').click( function(){
			$('#enable_site_editing').parent().submit();
		});
		});
		");
	}
}
?>